import use_case.handlereturns.DVD;
import use_case.handlereturns.Storage;
import use_case.handlereturns.itemDescription;
import use_case.processRental.Customer;
import use_case.processRental.Kiosk;
import use_case.processRental.Ledger;
import junit.framework.TestCase;


public class KioskTest extends TestCase {
	private Kiosk Redbox;
	private Storage inventory;
	private Ledger ledger;
	private itemDescription d1;
	private Customer customer;

	   public KioskTest(String name) {
	      super(name);
	   }
	   protected void setUp(){
		   inventory = new Storage(5);
		   inventory.initialize();
		   ledger = new Ledger();
		   Redbox = new Kiosk(inventory, ledger);
		   d1 = new DVD("Legend", "Action", 53124);
		   customer = new Customer("Tamer", "1231516460");
	   }
	   
	   protected void tearDown(){
		   Redbox = null;
		   inventory = null;
		   ledger = null;
		   d1 = null;
		   customer = null;
	   }
	   
	 //***********************************************
	 //Use Case Handle Returns
	   public void testReturnMode(){
		   setUp();
		   assertFalse(Redbox.returnMode(d1));
		   tearDown();
	   }
	   
	 //***********************************************
	   
	   
	   public void testRecordSale(){
		   setUp();
		   int expected = ledger.getNumberOfCustomers() + 1;
		   Redbox.recordSale(customer);
		   assertTrue(ledger.getNumberOfCustomers() == expected);
		   tearDown();
	   }
	   
	   public void testMakePayment(){
		   setUp();
		   assertTrue(Redbox.makePayment(customer));
		   tearDown();
	   }
	   
	   
	   
}
